package com.abel.quiz.vo;

import com.abel.quiz.po.OptionsPo;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import java.util.ArrayList;
import java.util.List;

import com.abel.quiz.po.QuestionPo;

/**
* @author abel.lin
* @date_time 2017-08-08 10:02
* @description
*/
public class QuestionDomain extends QuestionPo {

    private List<OptionsPo> optionsList;

    public static QuestionDomain genDomain(QuestionPo model){
        if(model == null){
            model = new QuestionPo();
        }
        QuestionDomain domain = JSON.parseObject(JSON.toJSONString(model), QuestionDomain.class);
        return domain;
    }

    public static List<QuestionDomain> genDomainList(List<QuestionPo> modelList){
        if(modelList == null){
            modelList = new ArrayList<QuestionPo>();
        }
        List<QuestionDomain> domainList = JSONArray.parseArray(JSONArray.toJSONString(modelList), QuestionDomain.class);
        return domainList;
    }

    public List<OptionsPo> getOptionsList() {
        return optionsList;
    }

    public void setOptionsList(List<OptionsPo> optionsList) {
        this.optionsList = optionsList;
    }

}
